package com.sports.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.sports.mapper.SportstypeMapper;
import com.sports.pojo.Sportstype;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class SportstypeServiceImpl implements ISportstypeService {
    @Autowired
    private SportstypeMapper mapper;


    @Override
    public List<Sportstype> list() {
        return mapper.selectList(new QueryWrapper<>());
    }

    @Override
    public Sportstype getById(Integer id) {
        return mapper.selectById(id);
    }

    @Override
    public Integer add(Sportstype sportsType) {
        return mapper.insert(sportsType);
    }

    @Override
    public Integer update(Sportstype sportsType) {
        return mapper.updateById(sportsType);
    }

    @Override
    public Integer delete(Integer id) {
        return mapper.deleteById(id);
    }

}
